package com.eddie.factory.abstractfactory.order;

import com.eddie.factory.abstractfactory.pizza.CheesePizza;
import com.eddie.factory.abstractfactory.pizza.GreekPizza;
import com.eddie.factory.abstractfactory.pizza.Pizza;
import com.eddie.factory.constant.PizzaConstant;

/**
 * @author Eddie
 * @date 2022/4/29 12:46
 */
public class TianjinFactory implements AbsFactory {

    private static final String REGION = "天津";

    protected Pizza createTastePizza(PizzaConstant type, String region) {
        Pizza pizza = null;
        if (type == PizzaConstant.CHEESE_NAME) {
            pizza = new CheesePizza(region);
        } else if (type == PizzaConstant.GREEK_NAME) {
            pizza = new GreekPizza(region);
        } else {
            System.out.println("暂时没有该口味");
        }
        return pizza;
    }

    @Override
    public Pizza createPizza(PizzaConstant type) {
        return createTastePizza(type, REGION);
    }
}
